package com.xy.redisson.properties;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

/**
 * @author xxy
 * @date 2022/1/5 20:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@PropertySource({"classpath:redisson.properties"})
@ConfigurationProperties(prefix = "redisson.lock.server")
public class RedissonProperties {

    /**
     * redis 地址
     */
    private String address;
    /**
     * 连接类型，支持standalone-单机节点，sentinel-哨兵，cluster-集群，masterslave-主从
     */
    private String type;
    /**
     * redis 连接密码
     */
    private String password;
    /**
     * 选取那个数据库
     */
    private int database;

    public void setPassword(String password) {
        this.password = password;
    }

    public void setDatabase(int database) {
        this.database = database;
    }
}
